package com.builder.inner;

public class Enviroment {

	private final String id;
	private final String transactionFactory;
	private final String dataSource;

	public Enviroment(String id, String transactionFactory, String dataSource) {
		super();
		this.id = id;
		this.transactionFactory = transactionFactory;
		this.dataSource = dataSource;
	}

	public static class Builder{
		private String id;
		private String transactionFactory;
		private String dataSource;

		public Builder(String id){
			this.id = id;
		}

		public Builder transactionFactory(String transactionFactory){
			this.transactionFactory = transactionFactory;
			return this;
		}

		public Builder dataSource(String dataSource){
			this.dataSource = dataSource;
			return this;
		}

		public Enviroment build(){
			return new Enviroment(this.id, this.transactionFactory, this.dataSource);
		}

	}

	public static void main(String[] args) {
		Enviroment.Builder eb = new Enviroment.Builder("123").transactionFactory("factory").dataSource("ds");
		Enviroment enviroment = eb.build();
	}

}
